1. Field of the Invention
The present invention relates to systems enabling software development, and more specifically to a method and apparatus for simplifying the implementation of custom atomic transactions in programming environments.
2. Related Art
An atomic transaction generally contains a set of tasks, which either together need to be completed or none executed. An example of an atomic transaction is transferring money electronically from bank account A to bank account B, in which a first task might involve debiting the money from A and a second task might involve crediting the money to B. As may be appreciated, it is generally required to complete both tasks or none executed.
In theory, it may be possible to implement an atomic transaction using entirely a hardware-based solution, in which the atomic transaction is executed potentially in a single clock cycle. such solutions are generally cost-prohibitive and also may not be usable for different types of atomic transactions.
Accordingly, typical data processing systems enable execution of tasks independently (either in sequence or with at least some level of parallelism), and a ‘rollback’ operation is performed with respect to the completed tasks (or portions thereof) if the atomic transaction is to be aborted in the middle. Rollback generally refers to restoring the state prior to executing the corresponding task. Thus, the general intended effect of rolling back the completed tasks is to restore to a state prior to the start of execution of the atomic operation.
Thus, in one prior approach, a programmer may have to design programs to keep track of the specific tasks that have completed, and rollback the completed tasks if an atomic transaction is to be aborted in the middle. Keeping track of the tasks adds to the complexity of design of the programs, and accordingly it is desirable to provide an improved approach to the manner in which atomic transactions are implemented in programming environments.
In the drawings, like reference numbers generally indicate identical, functionally similar, and/or structurally similar elements. The drawing in which an element first appears is indicated by the leftmost digit(s) in the corresponding reference number.